package com.example.demo1010.demo;

public class TBClick {
    private Discount discount;

    public void TBClick(Discount discount) {
        this.discount = discount;
    }
    public void buy(double price) {
        if (discount == null){
            System.out.println("无促销策略 : " + price);
        }else {
            System.out.println("打完折后 : " + discount.productPromotion(price));
        }
    }
}
